package cn.sofwin.day0107;

import java.util.Scanner;

public class Test05 {
     static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int price = 0;
        String choose = "y";

        while ("y".equals(choose)) {
            price += meau();
            System.out.print("是否继续（y/n）");
            choose = sc.next();

        }
        System.out.println("消费金额为" + price);

    }
        static int meau(){


            System.out.println("MyShooping管理系统》购物结算");
            System.out.println("*************************");
            System.out.println("请选择购买的商品编号：");
            System.out.println("1.T学" +"\t" + "2.网球鞋" + "\t" + "3.网球拍");
            System.out.println("**************************");
            System.out.print("请输入商品编号：");


            int number = sc.nextInt();
            int sum = 0;
            switch(number){
                case 1:
                    System.out.println("T恤 ￥245");
                    sum =245;
                    break;
                case 2:
                    System.out.println("网球鞋 ￥570");
                    sum = 570;
                    break;
                case 3:
                    System.out.println("网球拍 ￥320");
                    sum = 320;
                    break;
            }
            System.out.println("请输入购买数量");
            int amount = sc.nextInt();
            return sum * amount;
        }

}
